ThreadPool.this

This function creates a new thread pool similar to g_thread_pool_new() but allowing @item_free_func to be specified to free the data passed to g_thread_pool_push() in the case that the #GThreadPool is stopped and freed before all tasks have been executed.

  1. this(GThreadPool* gThreadPool, bool ownedRef)
  2. this(GFunc func, void* userData, int maxThreads, bool exclusive)
  3. this(GFunc func, void* userData, GDestroyNotify itemFreeFunc, int maxThreads, bool exclusive)
    class ThreadPool

Parameters

func GFunc

a function to execute in the threads of the new thread pool

userData void*

user data that is handed over to @func every time it is called

itemFreeFunc GDestroyNotify

used to pass as a free function to g_async_queue_new_full()

maxThreads int

the maximal number of threads to execute concurrently in the new thread pool, -1 means no limit

exclusive bool

should this thread pool be exclusive?

Return Value

the new #GThreadPool

Throws

GException on failure. ConstructionException GTK+ fails to create the object.

Meta

Since

2.70